import http from "@/network/http";
import { Pageble, TreasuryCheckin, UserTreasuryCheckin } from "@/types";

export type TreasuryCheckinCreateParams = Omit<TreasuryCheckin, 'treasuryCheckinId'>

export const createTreasuryCheckin = (params: TreasuryCheckinCreateParams) => {
  return http.post({
    url: '/treasury/checkin/create',
    data: params
  })
}

export const getTreasuryCheckinDetail = (treasuryId: number) => {
  return http.get({
    url: '/treasury/checkin/detail',
    data: { treasuryId }
  })
}

export const getTreasuryCheckinRecordList = (treasuryId: number, pageble: Pageble): Promise<UserTreasuryCheckin[]> => {
  return http.get({
    url: '/treasury/checkin/list',
    data: { treasuryId, ...pageble }
  })
}